import Vue from 'vue'
import App from './App'

import home from './pages/home/index.vue'
Vue.component('home',home)
import shop from './pages/shop/index.vue'
Vue.component('shop',shop)
import pay from './pages/pay/index.vue'
Vue.component('pay',pay)
import order from './pages/order/index.vue'
Vue.component('order',order)
import my from './pages/my/index.vue'
Vue.component('my',my)
import loadingCover from '@/components/loading-cover/loading-cover.vue';
Vue.component('loading-cover', loadingCover);

import MescrollUni from "@/components/mescroll/my-list-mescroll.vue";
Vue.component("mescroll-uni", MescrollUni); //上拉加载,下拉刷新组件

import MescrollBody from "@/components/mescroll/mescroll-body.vue"
Vue.component('mescroll-body', MescrollBody)

// vuex
import store from './store'

// 引入全局uView
import uView from '@/uni_modules/uview-ui'
import config from './utils/wxapi/config.js'
import mixin from './common/mixin'
import myApi from  './libs/method.js'

import {
	goTo,
	goBack,
	goToTab,
	goReLaunch,
	goRedirectTo,
	goToPage
} from '@/common/common.js'
Vue.prototype.$store = store

Vue.config.productionTip = false
const WXAPI = require('./libs/axios.js')
Vue.prototype.$http = WXAPI
Vue.prototype.imgUrl = config.imgUrl
Vue.prototype.wxappid = config.wxappid
Vue.prototype.$a = myApi

App.mpType = 'app'
Vue.use(uView)
Vue.prototype.goTo = goTo
Vue.prototype.goBack = goBack
Vue.prototype.goToTab = goToTab
Vue.prototype.goReLaunch = goReLaunch
Vue.prototype.goRedirectTo = goRedirectTo
Vue.prototype.goToPage = goToPage
Vue.prototype.baseURL = config.Url




Vue.mixin(mixin)

const app = new Vue({
	store,
	...App
})

// 引入请求封装
require('./util/request/index')(app)

app.$mount()
